<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>{$Think.config.WEB_CONFIG.TITLE}</title>
<link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
<link rel="stylesheet" type="text/css"
	href="__PUBLIC__/admin/css/font-awesome.min.css">
<link rel="stylesheet" href="__PUBLIC__/admin/css/app.css" media="all">
</head>

<body>
	<div class="layui-layout layui-layout-admin kit-layout-admin">
		<div class="layui-header">
			<div class="layui-logo">海南优思咨询管理后台</div>
			<div class="layui-logo kit-logo-mobile">K</div>
			<ul class="layui-nav layui-layout-left kit-nav" kit-one-level>
			</ul>
			<ul class="layui-nav layui-layout-right kit-nav">
				<li class="layui-nav-item"><a href="javascript:;"> <img
						src="http://m.zhengjinfan.cn/images/0.jpg" class="layui-nav-img">
						{$user_info.name}
				</a>
					<dl class="layui-nav-child">
						<dd>
							<a href="javascript:;">安全设置</a>
						</dd>
					</dl></li>
				<li class="layui-nav-item"><a href="javascript:;" id="logout"><i
						class="fa fa-sign-out" aria-hidden="true"></i> 注销</a></li>
			</ul>
		</div>

		<div class="layui-side layui-bg-black kit-side">
			<div class="layui-side-scroll">
				<div class="kit-side-fold">
					<i class="fa fa-navicon" aria-hidden="true"></i>
				</div>
				<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
				<ul class="layui-nav layui-nav-tree" lay-filter="kitNavbar"
					kit-navbar>
				</ul>
			</div>
		</div>
		<div class="layui-body" id="container">
			<!-- 内容主体区域 -->
			<div style="padding: 15px;">主体内容加载中,请稍等...</div>
		</div>

		<div class="layui-footer">
			<!-- 底部固定区域
			2017 &copy; <a href="http://kit.zhengjinfan.cn/">kit.zhengjinfan.cn/</a>
			MIT license
			 -->
			{$Think.config.WEB_CONFIG.COPYRIGHT}
		</div>
	</div>
	<script src="__PUBLIC__/layui/layui.js"></script>
	<script type="text/javascript"
		src="__PUBLIC__/common/js/jquery-2.0.3.min.js"></script>
	<script type="text/javascript">
		$(function() {
			$("#logout").click(function() {
				layui.use('layer', function() {
					var layer = layui.layer;
					layer.confirm('确认注销当前账号？', {
						icon : 3,
						title : '提示'
					}, function(index) {
						var cache = layui.data('cache');
						console.log(cache);
						$.ajax({
							type : 'POST',
							data : {
								token : cache.token
							},
							url : "{:U('Public/logout')}",
							success : function(res) {
								layer.close(index);
								if (res.status == 1) {
									layui.data('cache', null);
									layer.alert(res.info, {
										icon : 1,
										closeBtn : 0
									}, function(index) {
										location.href = res.url;
									});
								} else {
									layui.data('cache', null);
									layer.msg(res.info, {
										icon : 2,
										time : 1000
									}, function() {
										location.href = res.url;
									});
								}
							}
						});
					});
				});
			});
		});
	</script>
	<script>
		var message;
		layui.config({
			base : '../assets/admin/js/'
		}).use([ 'app', 'message', 'onelevel' ], function() {
			var app = layui.app, $ = layui.jquery, layer = layui.layer;
			//将message设置为全局以便子页面调用
			message = layui.message;
			//主入口
			app.set({
				type : 'iframe',
				levelurl : "{:U('Public/menus')}",
				navurl : "{:U('Public/navMenus')}"
			}).init();
			$('#pay').on('click', function() {
				layer.open({
					title : false,
					type : 1,
					content : '<img src="/build/images/pay.png" />',
					area : [ '500px', '250px' ],
					shadeClose : true
				});
			});
		});
	</script>
</body>

</html>